package test_unitaire;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import buisness_service.Finance_annee;
import buisness_service.Finance_mois;
import buisness_service.Rapport;
import buisness_service.Rapport.Mois;
import buisness_service.User;

public class Test_Finance_mois {

	@Test
	public void testFinance_moisIntInt() {

		User u = new User();
		Finance_annee f_a = new Finance_annee(2008,u.getRapport());
		Finance_mois f = new Finance_mois(Mois.Mai, f_a, u);
		assertTrue(f.getMois() == Mois.Mai);
		assertTrue(f.getIndexFinance_annee() == f_a.getIndex_annee());
		assertTrue(f_a.getFinances_mois().get(0) == f);
		assertTrue(u.getRapport().get(f.getIndexFinance_annee())
				.getFinances_mois().get(f.getIndex_finance_mois()) == f);
		assertTrue(u.getRapport().get(f.getIndexFinance_annee())
				.getFinances_mois().get(f.getIndex_finance_mois())
				.getDep_mois() == f.getDep_mois());
		assertTrue(u.getRapport().get(f.getIndexFinance_annee())
				.getFinances_mois().get(f.getIndex_finance_mois())
				.getRev_mois() == f.getRev_mois());

		
		Rapport.postesDpenses.clear();
		Rapport.postesRevenus.clear();
	}

}
